Fix DMA compile for x86_64.
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Tue, 12 Jul 2005 13:19:10 +0000 (13:19 +0000)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Tue, 12 Jul 2005 13:19:10 +0000 (13:19 +0000)
Signed-off-by: Xin Li <xin.b.li@intel.com>
linux-2.6-xen-sparse/arch/xen/x86_64/kernel/pci-dma.c
linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/dma-mapping.h

index e8f80155a28e13d9cf302ba4d0cfaf94df1ff314..b21c7df4f0092d5d104e3360ede719a9d431df17 100644 (file)
@@ -231,7 +231,7 @@ dma_map_single(struct device *dev, void *ptr, size_t size,
         * boundary. Take into account buffer start offset. All other calls are
         * conservative and always search the dma_map list if it's non-empty.
         */
-       if ((((unsigned int)ptr & ~PAGE_MASK) + size) <= PAGE_SIZE) {
+       if (((((unsigned long)ptr) & ~PAGE_MASK) + size) <= PAGE_SIZE) {
                dma = virt_to_bus(ptr);
        } else {
                BUG_ON((bnc = dma_alloc_coherent(dev, size, &dma, 0)) == NULL);
@@ -247,7 +247,7 @@ dma_map_single(struct device *dev, void *ptr, size_t size,
                spin_unlock_irqrestore(&dma_map_lock, flags);
        }
 
-       if ((dma+size) & ~*hwdev->dma_mask)
+       if ((dma+size) & ~*dev->dma_mask)
                out_of_line_bug();
        return dma;
 }
index 295183bbafeaf8a3c4f6ca8b479345b39d597373..b280f92ad9c1e25bbab5c51c23551e8af369aeea 100644 (file)
@@ -22,20 +22,20 @@ void dma_free_coherent(struct device *dev, size_t size, void *vaddr,
                         dma_addr_t dma_handle);
 
 extern dma_addr_t dma_map_single(struct device *hwdev, void *ptr, size_t size,
-                                int direction);
+                                enum dma_data_direction direction);
 extern void dma_unmap_single(struct device *dev, dma_addr_t addr,size_t size,
-                            int direction);
+                            enum dma_data_direction direction);
 
 #define dma_map_page(dev,page,offset,size,dir) \
        dma_map_single((dev), page_address(page)+(offset), (size), (dir))
 
 extern void
 dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, size_t size,
-                       int direction);
+                       enum dma_data_direction direction);
 
 extern void
 dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle, size_t size,
-                           int direction);
+                           enum dma_data_direction direction);
 
 static inline void dma_sync_sg_for_cpu(struct device *hwdev,
                                       struct scatterlist *sg,